<?php $theme_options = get_option('po_theme');
// BODY
$background_color = $theme_options['background_color'];
$pattenr = $theme_options['pattenr'];
$background_image = $theme_options['background_image'];
$background_image_position = $theme_options['background_image_position'];
$background_repeat = $theme_options['background_repeat'];

// MENU
$menu_color = $theme_options['menu_color'];
$menu_hover_color = $theme_options['menu_hover_color'];
$menu_bg_color = $theme_options['menu_bg_color'];
$menu_hover_bg_color = $theme_options['menu_hover_bg_color'];
$menu_selected_color = $theme_options['menu_selected_color'];
$menu_selected_bg_color = $theme_options['menu_selected_bg_color'];

// TITLES
$h1_color = $theme_options['h1_color'];
$titles_color = $theme_options['titles_color'];
$titles_font = $theme_options['titles_font'];
$titles_font_weight = $theme_options['titles_font_weight'];

// CONTENT
$font = $theme_options['font'];
$links_color = $theme_options['links_color'];
$links_hover_color = $theme_options['links_hover_color'];
$welcome_text_align = $theme_options['welcome_text_align'];
$welcome_text_size = $theme_options['welcome_text_size'];

// CUSTOM CSS
$custom_css = $theme_options['custom_css'];

echo '<style type="text/css" media="all">';

/*== BODY ======================================*/
if ($background_color || $background_image || ($pattenr != "none")) {
	echo 'body {';
		if ($background_color) { echo 'background-color:#'.$background_color.'; ';};
		if ($background_image) { echo 'background-image:url('.$background_image.'); ';}
			elseif ($pattenr != "none") { echo 'background-image:url(/wp-content/themes/polafolio/images/patterns/'.$pattenr.'.png); ';
		};
		if ($background_image_position!="select") { echo 'background-position:'.$background_image_position.'; ';};
		if ($background_repeat!="select") { echo 'background-repeat: '.$background_repeat.'; ';};
	echo '} ';
};
if ($font) {
	echo'td, body, div {';
		if ($font=="Lucida Grande") { echo 'font-family:"'.$font.'","Lucida Sans Unicode", sans-serif; ';}
		elseif ($font=="Arial") { echo 'font-family:'.$font.', sans-serif; ';}
		elseif ($font=="Tahoma") { echo 'font-family:'.$font.', sans-serif; ';}
		elseif ($font=="Verdana") { echo 'font-family:'.$font.', sans-serif; ';}
		elseif ($font=="Georgia") { echo 'font-family:'.$font.', serif; '; }
		elseif ($font=="Times New Roman") { echo 'font-family:'.$font.', Times, serif; ';}
	echo '} ';
}
/*== MENU ======================================*/
if ($menu_color) {
	echo 'ul.menu li a, div.menu ul li a {color:#'.$menu_color.';} ';
};
if ($menu_selected_color || $menu_selected_bg_color) {
	echo'ul.menu .active:hover, ul.menu .active, ul.menu > li.current-cat > a, ul.menu > li.current-cat-parent > a, ul.menu > li.current_page_item > a, ul.menu > li.current_page_parent > a, div.menu ul .active:hover, div.menu ul .active, div.menu ul > li.current-cat > a, div.menu ul > li.current-cat-parent > a, div.menu ul > li.current_page_item > a, div.menu ul > li.current_page_parent > a {';
		if ($menu_selected_color) { echo 'color:#'.$menu_selected_color.'; ';};
		if ($menu_selected_bg_color) { echo 'background-color:#'.$menu_selected_bg_color.'; ';};
	echo '} ';
};
if ($menu_hover_color || $menu_hover_bg_color) {
	echo'ul.menu > li.hover > a, div.menu ul > li.hover > a, ul.menu ul > li, div.menu ul ul > li {';
		if ($menu_hover_color) { echo 'color:#'.$menu_hover_color.' !important; ';};
		if ($menu_hover_bg_color) { echo 'background-color:#'.$menu_hover_bg_color.'; ';};
	echo '} ';
};
if ($menu_hover_color) {
	echo 'ul.menu ul li a, div.menu ul ul li a {color:#'.$menu_hover_color.' !important;} ';
};
/*== TITLES ======================================*/
if ($h1_color) {
	echo '#header h1.logo, #header h1.logo a, div#phone, .wp-pagenavi span.pages {color:#'.$h1_color.';} ';
};
if ($titles_color) {
	echo '#content h1, h2, h3, h4, h5, h6, #title2 h1, h2 a, h3 a, h4 a, h5 a, h6 a {color:#'.$titles_color.';} ';
};
if (($titles_font != 'select') || ($titles_font != 'QlassikBoldRegular') || ($titles_font != 'FertigoProRegular') || ($titles_font != 'ColaborateLight')) {
	echo 'h1, h2, h3, h4, h5, h6, blockquote, a.bigbutton, #commentform #submit, .feederss-label, .feedemail-label, #contentbox form .pushbutton-wide, .ui-tabs-nav a {';
		if ($titles_font=="Lucida Grande") { echo 'font-family:"'.$titles_font.'","Lucida Sans Unicode", sans-serif; letter-spacing:-0.05em; '; }
		elseif ($titles_font=="Arial") { echo 'font-family:'.$titles_font.', sans-serif; letter-spacing:-0.03em; '; }
		elseif ($titles_font=="Tahoma") { echo 'font-family:'.$titles_font.', sans-serif; letter-spacing:-0.02em; '; }
		elseif ($titles_font=="Verdana") { echo 'font-family:'.$titles_font.', sans-serif; letter-spacing:-0.04em; '; }
		elseif ($titles_font=="Georgia") { echo 'font-family:'.$titles_font.', serif; letter-spacing:-0.02em; '; }
		elseif ($titles_font=="Times New Roman") { echo 'font-family:'.$titles_font.', Times, serif; letter-spacing:-0.02em; '; }
	echo '} ';
};
/*== LINKS ======================================*/
if ($links_color) {
	echo 'a {color:#'.$links_color.';} ';
};
if ($links_hover_color) {
	echo 'a:hover, a.button:hover, a.button2:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { color:#'.$links_hover_color.';} ';
};
if ($links_hover_color) {
	echo '#but-prev a:hover, #but-next a:hover, #but-prev-next a:hover, #commentform #submit:hover, #contentbox form .pushbutton-wide:hover {border:1px solid #'.$links_hover_color.';} ';
};
if ($links_color) {
	echo '.wp-pagenavi span.current {background-color:#'.$links_color.'; border:1px solid #'.$links_color.';} ';
};
if ($links_color) {
	echo '.wp-pagenavi a, .wp-pagenavi a:link {border:1px solid #'.$links_color.';} ';
};
if ($links_color) {
	echo '.wp-pagenavi a:hover {border:1px solid #'.$links_color.';} ';
};
/*== CUSTOM CSS ======================================*/
echo $custom_css;

echo '</style>';
?>	